/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.volatileshooter;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import com.volatileshooter.state.GameState;
import com.volatileshooter.state.MenuState;

/**
 * @author Ahmed
 *
 */
public class Main extends StateBasedGame {
	/**
	 * menuState.
	 */
	private MenuState menuState;

	/**
	 * gameState.
	 */
	private GameState gameState;

	/**
	 * Main.
	 * @param title title
	 */
	public Main(final String title) {
		super(title);
	}

	@Override
	public void initStatesList(final GameContainer container) throws SlickException {
		menuState = new MenuState(container, this, "mainmenu.xml");
		gameState = new GameState(menuState.getID());

		addState(menuState);
		addState(gameState);
	}

	/**
	 * start here.
	 * @param args args
	 */
	public static void main(final String[] args) {
		try {
			AppGameContainer container = new AppGameContainer(new Main("Gravitron!"));
			container.setDisplayMode(1024, 768, false);
			container.setTargetFrameRate(1000);
			container.setMinimumLogicUpdateInterval(1);
			container.setMinimumLogicUpdateInterval(2);
			container.start();
		} catch (SlickException e) {
			e.printStackTrace();
		}
	}
}
